package constants

import "time"

// API接口列表
var APIEndpoints = []string{
	"https://v2.xxapi.cn/api/heisi",
	"https://v2.xxapi.cn/api/meinvpic",
	"https://v2.xxapi.cn/api/baisi",
	"https://v2.xxapi.cn/api/wapmeinvpic",
	"https://v2.xxapi.cn/api/yscos",
}

// 视频API接口列表
var VideoAPIEndpoints = []string{
	"https://v2.xxapi.cn/api/meinv",
}

// User-Agent列表用于防限流
var UserAgents = []string{
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15",
	"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
}

// HTTP配置常量
const (
	HTTPTimeout          = 30 * time.Second
	IdleConnTimeout      = 30 * time.Second
	MaxIdleConns         = 10
	MaxIdleConnsPerHost  = 10
	DefaultWorkerCount   = 20
	TaskInterval         = 10 * time.Second
	GracefulShutdownTime = 30 * time.Second
	RetryDelay           = 100 * time.Millisecond
)

// API相关常量
const (
	APISuccessCode  = 200
	DefaultAPICount = 3
	HTTPStatusOK    = 200
)

// 请求头常量
const (
	UserAgentHeader      = "User-Agent"
	AcceptHeader         = "Accept"
	AcceptLanguageHeader = "Accept-Language"
	ConnectionHeader     = "Connection"
	RefererHeader        = "Referer"
	OriginHeader         = "Origin"
)

// 请求头值常量
const (
	DefaultAccept         = "application/json, text/plain, */*"
	DefaultAcceptLanguage = "zh-CN,zh;q=0.9,en;q=0.8"
	DefaultConnection     = "keep-alive"
	DefaultReferer        = "https://v2.xxapi.cn/"
	DefaultOrigin         = "https://v2.xxapi.cn"
	ImageAccept           = "image/webp,image/apng,image/*,*/*;q=0.8"
)

// WebP配置常量
const (
	WebPLossless = false
	WebPQuality  = 80
)

// 文件权限常量
const (
	DirPermission = 0755
)
